package com.shengyuan.manage_os.old.ying.erpm.controls;

import com.shengyuan.manage_os.old.ying.boce.jsy.PT_yhmc;
import com.shengyuan.manage_os.old.ying.erpm.LoginActivity;
import com.shengyuan.manage_os.old.ying.erpm.util.SharePreferenceUtil;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;

public class CurrentPersonal extends TextView {

	public static String UserName="";


	
	public CurrentPersonal(Context context) {
		super(context);

	}
	public CurrentPersonal(Context context, AttributeSet attrs) {
		super(context,attrs);
		try {
			String text="";
			if(LoginActivity.pmUser == null ){
				LoginActivity.pmUser = new PT_yhmc();
				SharePreferenceUtil util = SharePreferenceUtil.init(context, "SAVE_USER");
				LoginActivity.pmUser.UserName = util.getName();
			}
			else if (LoginActivity.pmUser.UserName.equals("")) {
				SharePreferenceUtil util = SharePreferenceUtil.init(context, "SAVE_USER");
				LoginActivity.pmUser.UserName = util.getName();
				text = util.getName();
			}else {
				text = LoginActivity.pmUser.UserName;
			}

			UserName = text;
			this.setText(UserName);
		} catch (Exception e) {
		}
	}
}
